package com.example.app2024.mnote;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class NotesDB extends SQLiteOpenHelper
{

      public static final String TABLE_NAME = "notes";

      //以下为数据库列名
      public static final String CONTENT = "content";
      public static final String PATH = "path";
      public static final String VIDEO = "video";
      public static final String ID = "_id";
      public static final String TIME = "time";

      public NotesDB(Context context)
      {
            super(context, "notes", null, 1);
      }

      @Override
      public void onCreate(SQLiteDatabase db)
      {
            Log.i("TAGAA", "onCreate: 数据库创建了");
            db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + CONTENT + " TEXT NOT NULL," + PATH + " TEXT NOT NULL," + VIDEO + " TEXT NOT NULL," + TIME + " TEXT NOT NULL)");
      }

      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
      {

      }

}
